# TencentBlueKing is pleased to support the open source community by making
# 蓝鲸智云 - PaaS 平台 (BlueKing - PaaS System) available.
# Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.
# Licensed under the MIT License (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
#     http://opensource.org/licenses/MIT
#
# Unless required by applicable law or agreed to in writing, software distributed under
# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
# either express or implied. See the License for the specific language governing permissions and
# limitations under the License.
#
# We undertake not to change the open source license (MIT license) applicable
# to the current version of the project delivered to anyone in the future.

# Generated by Django 3.2.12 on 2023-03-21 02:38

from django.db import migrations, models
import django.db.models.deletion
import paasng.accessories.log.models
import uuid


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('applications', '0009_application_is_scene_app'),
    ]

    operations = [
        migrations.CreateModel(
            name='ElasticSearchConfig',
            fields=[
                ('uuid', models.UUIDField(auto_created=True, default=uuid.uuid4, editable=False, primary_key=True, serialize=False, unique=True, verbose_name='UUID')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('collector_config_id', models.CharField(help_text='采集配置ID', max_length=64, unique=True, verbose_name='采集配置ID')),
                ('backend_type', models.CharField(help_text="日志后端类型, 可选 'es', 'bkLog' ", max_length=16)),
                ('elastic_search_host', paasng.accessories.log.models.ElasticSearchHostField(help_text="required when backend_type is 'es'", null=True)),
                ('bk_log_config', paasng.accessories.log.models.BKLogConfigField(help_text="required when backend_type is 'bkLog'", null=True)),
                ('search_params', paasng.accessories.log.models.ElasticSearchParamsField(help_text='ES 搜索相关配置')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='ProcessStructureLogCollectorConfig',
            fields=[
                ('created', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('collector_config_id', models.BigAutoField(primary_key=True, serialize=False, verbose_name='采集配置ID')),
                ('process_type', models.CharField(help_text='进程类型(名称)', max_length=16)),
                ('config', paasng.accessories.log.models.ContainerLogCollectorConfigField(null=True)),
                ('application', models.ForeignKey(db_constraint=False, on_delete=django.db.models.deletion.CASCADE, to='applications.application')),
                ('env', models.ForeignKey(db_constraint=False, on_delete=django.db.models.deletion.CASCADE, to='applications.applicationenvironment')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='ProcessLogQueryConfig',
            fields=[
                ('uuid', models.UUIDField(auto_created=True, default=uuid.uuid4, editable=False, primary_key=True, serialize=False, unique=True, verbose_name='UUID')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('process_type', models.CharField(blank=True, help_text='默认配置使用 ', max_length=16, null=True, verbose_name='进程类型(名称)')),
                ('env', models.ForeignKey(db_constraint=False, on_delete=django.db.models.deletion.CASCADE, to='applications.applicationenvironment')),
                ('ingress', models.ForeignKey(db_constraint=False, help_text='接入层日志配置', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='related_ingress', to='log.elasticsearchconfig')),
                ('json', models.ForeignKey(db_constraint=False, help_text='结构化日志配置', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='related_json', to='log.elasticsearchconfig')),
                ('stdout', models.ForeignKey(db_constraint=False, help_text='标准输出日志配置', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='related_stdout', to='log.elasticsearchconfig')),
            ],
            options={
                'abstract': False,
            },
        ),
    ]
